#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    vector<vector<int>> res;
    void dfs(int cur, vector<int>& stor, const vector<int>& nums)
    {
        unordered_set<int> uset;
        if (stor.size() > 1)
            res.push_back(stor);
        for (int i = cur; i < nums.size(); i++)
        {
            if ((stor.empty() || stor.back() <= nums[i]) && uset.find(nums[i]) == uset.end())
            {
                stor.push_back(nums[i]);
                uset.insert(nums[i]);
                dfs(i + 1, stor, nums);
                stor.pop_back();
            }
        }
    }
    vector<vector<int>> findSubsequences(vector<int>& nums) {
        vector<int> tmp;
        dfs(0, tmp, nums);
        return res;
    }
};